﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Client_Server_Interface;
using Microsoft.Win32;


namespace BTM_Client_Application.SupportClasses
{
    class MyOpenFileDialog
    {
        private OpenFileDialog _dialog;

        public MyOpenFileDialog()
        {
            _dialog = new OpenFileDialog();
            _dialog.DefaultExt = ".gmdb";
            _dialog.Filter = "Map database (.gmdb)|*.gmdb";
            _dialog.ShowReadOnly = true;
            _dialog.Multiselect = false;
        }

        public string Show()
        {
            bool? ifok = _dialog.ShowDialog();
            if(ifok == false)
                throw new IncorrectInputValueException("", "");
            return _dialog.FileName;
        }
    }
}
